class MyThread extends Thread{
    @Override
    public void run() {
        System.out.println("线程1");
    }
}
class MyRunnable implements Runnable {
    @Override
    public void run() {
        System.out.println("线程2");
    }
}
public class Test {
    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        myThread.start();

        Thread thread = new Thread(new MyRunnable());
        thread.start();

        Thread thread1 = new Thread(){
            @Override
            public void run() {
                System.out.println("线程3");
            }
        };
        thread1.start();

        Thread thread2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程4");
            }
        });
        thread2.start();

        Thread thread3 = new Thread(()->{
            System.out.println("线程5");
        });
        thread3.start();

    }
}
